package com.huadao.cart_ccs.modle;

import com.huadao.cart_ccs.base.BaseSerialPortModel;
import com.huadao.cart_ccs.common.ByteUtils;
import com.huadao.cart_ccs.data.bo.CommandWord;
import com.huadao.cart_ccs.data.bo.DoorBO;
import com.huadao.cart_ccs.data.bo.Protocol;

public class DoorModle extends BaseSerialPortModel {
    private String TAG="门";

    public void open(){
        Protocol params= ByteUtils.generateProtocol(CommandWord.write,new byte[]{DoorBO.ModularType_Door,DoorBO.door_NO1,DoorBO.open},null);
        serialPortRequest(params);
    }

    public void close(){
        Protocol params= ByteUtils.generateProtocol(CommandWord.write,new byte[]{DoorBO.ModularType_Door,DoorBO.door_NO1,DoorBO.close},null);
        serialPortRequest(params);
    }

    public void read(){
        Protocol params= ByteUtils.generateProtocol(CommandWord.read,new byte[]{DoorBO.ModularType_Door,DoorBO.door_NO1,DoorBO.read},null);
        serialPortRequest(params);
    }

    public void stop() {
        Protocol params= ByteUtils.generateProtocol(CommandWord.write,new byte[]{DoorBO.ModularType_Door,DoorBO.door_NO1,DoorBO.stop},null);
        serialPortRequest(params);
    }
}
